package com.cqtczh.qhd.driver.acticity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;
import com.google.zxing.CaptureActivity;
import com.cqtczh.qhd.driver.R;
import com.cqtczh.qhd.driver.acticity.base.BaseActivity;
import com.cqtczh.qhd.driver.utils.StringUtils;

public class AboutUsActivity extends BaseActivity implements OnClickListener {

	private TabHost mTabHost;
	private RadioGroup mRadioGroup;
	private TextView title, head_right;
	private ImageView head_left;
	private WebView webView;
	private String url;
	
	
	@SuppressLint("NewApi")
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aj_settings_my);
		String mark = getIntent().getStringExtra("mark");
		
		if(!(StringUtils.isEmpty(mark))) {
			title = (TextView) findViewById(R.id.head_title);
			head_left = (ImageView) findViewById(R.id.head_left);
			
			head_left.setOnClickListener(this);
			head_left.setVisibility(0);
			webView = (WebView)findViewById(R.id.a0_common);
		//	if(mark.equals("运输服务条款")) url = "file:///android_asset/ce/ystk.htm";
			if(mark.equals("Q货的介绍")) {
				url = "file:///android_asset/ce/cehdjs.htm";
				
			}
			webView.getSettings().setDefaultTextEncodingName("UTF-8");
		//	if(mark.equals("用户协议")) url = "file:///android_asset/ce/xy.htm";
			if(mark.equals("用户协议")) url = "file:///android_asset/ce/user_rout_sj.htm";

			title.setText(mark);		
			webView.loadUrl(url);
		//	webView.loadDataWithBaseURL(null, url, "text/html", "UTF-8", null);
			
			webView.setWebViewClient(new WebViewClient());
			WebSettings webSettings = webView.getSettings();
			webSettings.setJavaScriptEnabled(true);
		}
		
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.head_left:
			finish();
			break;
		default:
			break;
		}
	}


}
